home *** CD-ROM | disk | FTP | other *** search
/ Power Tools for Macintosh / Power Tools for Macintosh (SoftBit)(1992).iso / Stacks / *S-Z / Script Stripper / Script Stripper v2.0 / stack_-1.xml < prev    next >
Encoding:
Extensible Markup Language  |  1993-06-05  |  12.2 KB  |  20 lines

  1. <?xml version="1.0" encoding="utf-8" ?>
  2. <!DOCTYPE stack PUBLIC "-//Apple, Inc.//DTD stack V 2.0//EN" "" >
  3. <stack>
  4.     <name>in.0</name>
  5.     <id>-1</id>
  6.     <cardCount>1</cardCount>
  7.     <cardID>2837</cardID>
  8.     <listID>4613</listID>
  9.     <cantModify><false /></cantModify>
  10.     <cantDelete><true /></cantDelete>
  11.     <cantAbort><false /></cantAbort>
  12.     <cardSize>
  13.         <width>512</width>
  14.         <height>342</height>
  15.     </cardSize>
  16.     <script>2.0
  17.  
  18. on openStack
  19. hide menuBar
  20. aboutTheStripper
  21. put line 1 of script of this stack into bg fld "the version of"
  22. end openStack
  23.  
  24. on closeStack
  25. show menuBar
  26. end closeStack
  27.  
  28. on aboutTheStripper
  29. put "About Script Stripper..." into menuItem 1 of menu "Apple" with ¬¨
  30. menuMsg "about"
  31. end aboutTheStripper
  32.  
  33. on about
  34. -- use "Hard Spaces" (eg: <Option-Space>) to create formatted
  35. -- output in a dialog box
  36. answer "¬†¬†¬†¬†"&quote&"Script Stripper,"&quote&&"a HyperCard script"¬¨
  37. &&"¬†¬†¬†¬†¬†¬†¬†¬†¬†¬†¬†¬†extraction utility."¬¨
  38. &&" _____________________________________"¬
  39. &&"¬†¬†¬†¬†¬†¬†¬†¬†¬©1993, Donald J. Winiecki"¬¨
  40. &&"¬†¬†¬†¬†¬†¬†¬†¬†¬†5202 Bangor Ave., H 204"¬¨
  41. &&"¬†¬†¬†¬†¬†¬†¬†   ¬†¬† ¬†¬†¬†¬†¬† ¬†¬†¬†Lubbock, TX. 79414"¬¨
  42. &&"¬†¬†¬†¬†¬†¬†¬†¬†¬†¬†¬†¬† {806}¬†792-5253" with "More..." or "Done"
  43. if it = "More..." then
  44. lock screen
  45. show cd fld "Stripper Help"
  46. show cd btn "Hide Stripper Help"
  47. set the hilite of cd btn "Hide Stripper Help" to true
  48. set the scroll of cd fld "Stripper Help" to 533 -- go to specific point in "Help" field
  49. unlock screen with scroll down
  50. end if
  51. end about
  52.  
  53. on checkIfCompactNeeded
  54. -- keep the stack lean (copying & moving text builds LOTS of freespace)
  55. -- this handler is from pp. 207 of "The Complete Book of HyperTalk 2, by Dan Shafer
  56. put size of this stack into stackSize
  57. put freeSize of this stack into freeSpace
  58. if freeSpace > (.3 * stackSize) then -- if freeSpace exceeds 30% of stack's size
  59. answer "¬†¬†"&quote&"Script Stripper"&quote&&"should be compacted"¬¨
  60. &&"¬†¬†¬†¬†¬†¬†¬†¬†¬†¬†before we continue." with "Ok"
  61. doMenu "Compact Stack"
  62. end if
  63. end checkIfCompactNeeded
  64.  
  65. on whereItsSaved
  66. global thisStack, stackNameTruncated_G
  67. if stackNameTruncated_G is not empty then
  68. -- if the ".strip" file name had to be truncated ‚Ä¢‚Ä¢ (6/5/93)
  69. answer "Scripts for:"&&quote&stackNameTruncated_G&quote&&"have been saved in"¬¨
  70. &&"the"&&quote&"~Script Stripper Textfiles"&quote&&"folder"¬¨
  71. &&"as:"&&quote&stackNameTruncated_G&".strip."&quote with "Oh Boy !"
  72. else
  73. answer "Scripts for:"&&quote&thisStack&quote&&"have been saved in"¬¨
  74. &&"the"&&quote&"~Script Stripper Textfiles"&quote&&"folder"¬¨
  75. &&"as:"&&quote&thisStack&".strip."&quote with "Oh Boy !"
  76. end if
  77. end whereItsSaved
  78.  
  79. function underScore
  80. -- declare and use a function instead of typing this thing every time
  81. return "_____________________________________________________"
  82. end underScore
  83.  
  84. on retrieveStackScript
  85. global thisStack_G, thisStack, stackNameTruncated_G
  86. push card -- remember where to come back to
  87. put empty into thisStack
  88. put empty into thisStack_G
  89. put empty into stackNameTruncated_G
  90.  
  91. -- find the short name of the "Script Stripper"
  92. repeat with i = number of chars in long name of this stack down to 1
  93. set cursor to busy
  94. -- keep the last item in the path statement
  95. if char i of long name of this stack = ":" then exit repeat
  96. put char i of long name of this stack before temp
  97. end repeat
  98.  
  99. -- establish the path to where the "Stripped" script will be stored {stored in 'filePath'}
  100. -- (!!!!user should not change file/folder names or location of the "...Textfiles" folder)
  101. repeat with i = 8 to (number of chars in long name of this stack - (number of chars in temp + 1))
  102. set cursor to busy
  103. put char i of long name of this stack after filePath
  104. end repeat
  105.  
  106. -- request user to maneuver to and identify stack to be stripped
  107. -- full path to the desired stack is put into "it"
  108. answer file "Strip which stack's scripts ?" of type "STAK"
  109.  
  110. -- if user decides not to do it then bail out...
  111. if it is empty then
  112. answer "¬†Script Stripping Operation Aborted!" with "Whew !"
  113. exit retrieveStackScript
  114. end if
  115.  
  116. -- store the full path name of the stack to be stripped into global variable 'thisStack_G'
  117. put it into thisStack_G
  118.  
  119. -- establish the name of the textfile to be created for this stripping session
  120. repeat with i = number of chars in thisStack_G down to 1
  121. set cursor to busy
  122. if char i of thisStack_G = ":" then exit repeat
  123. put char i of thisStack_G before thisStack
  124. end repeat
  125.  
  126. -- write my tag line into the holder variable (strippingHolder)
  127. put quote&"Script Stripper"&&line 1 of script of this stack&quote&&"HyperCard"¬¨
  128. &&"script extractor."&return&"¬©1992, 1993. Donald J. Winiecki, all rights reserved."&return ¬¨
  129. &"‚àû‚àû‚àû‚àû‚àû‚àû‚àû‚àû‚àû‚àû‚àû‚àû‚àû‚àû‚àû‚àû‚àû‚àû‚àû‚àû‚àû‚àû‚àû‚àû‚àû‚àû‚àû‚àû‚àû‚àû‚àû‚àû"&return&return into strippingHolder
  130.  
  131. set lockMessages to true
  132. lock screen
  133. go stack thisStack_G
  134.  
  135. -- write the selected stack's script after holder variable
  136. put "‚Ä¢ Name of Stack:"&&quote&thisStack&quote&return after strippingHolder
  137.  
  138. -- write some stack statistics
  139. put the userLevel into it
  140. if it = 1 then put "1;"&&quote&"Browsing"&quote into it
  141. if it = 2 then put "2;"&&quote&"Typing"&quote into it
  142. if it = 3 then put "3;"&&quote&"Painting"&quote into it
  143. if it = 4 then put "4;"&&quote&"Authoring"&quote into it
  144. if it = 5 then put "5;"&&quote&"Scripting"&quote into it
  145. put "‚Ä¢ Size of Stack:"&&size of this stack / 1000&&"KB."&return after strippingHolder
  146. put "‚Ä¢ Free Space in Stack:"&&the freeSize of this stack / 1000&&"KB."&return after strippingHolder
  147. put "‚Ä¢ User Level of Stack:"&&it&return&return after strippingHolder
  148. put "‚Ä¢ Date of Stripping:"&&the long date&return after strippingHolder
  149. put "‚Ä¢ Time of Stripping:"&&the time&return&return after strippingHolder
  150. put "‚óä ‚óä Starting scripts of Stack:"&&quote&thisStack&quote&" ‚óä ‚óä"&return&return after strippingHolder
  151. put "‚Ä¢ ‚Ä¢ Script of Stack:"&&quote&thisStack&quote&" ‚Ä¢ ‚Ä¢"&return after strippingHolder
  152. put underScore()&return after strippingHolder
  153. if script of stack thisStack_G is not empty then
  154. put script of stack thisStack_G after strippingHolder
  155. else
  156. put "* No script at the Stack Level" after strippingHolder
  157. end if
  158. put return&return after strippingHolder
  159.  
  160. go to first cd of stack thisStack_G
  161.  
  162. repeat with i = 1 to the number of bgs
  163. go bg i
  164. set cursor to busy
  165. put empty into j
  166. put empty into k
  167.  
  168. put "‚Ä¢ ‚óä Scripts of Background"&&i&";"&&quote&short name of this bg¬¨
  169. &quote&return after strippingHolder
  170. put underScore()&return after strippingHolder
  171. if script of bg i is empty then
  172. put "* No script for this Background" after strippingHolder
  173. else
  174. put script of bg i after strippingHolder
  175. end if
  176. put return&return after strippingHolder
  177.  
  178. repeat with k = 1 to number of bg btns
  179. set cursor to busy
  180. put "‚Ä¢ Script of Background Button:"&&k&";"&&quote&short name of bg btn k¬¨
  181. &quote&&"of Background"&&i&return after strippingHolder
  182. put underScore()&return after strippingHolder
  183. if script of bg btn k is empty then
  184. put "* No script for this Background Button" after strippingHolder
  185. else
  186. put script of bg btn k after strippingHolder
  187. end if
  188. put return&return after strippingHolder
  189. end repeat
  190.  
  191. repeat with j = 1 to number of bg flds
  192. set cursor to busy
  193. put "‚Ä¢ Script of Background Field"&&j&";"&&quote&short name of bg fld j¬¨
  194. &quote&&"of Background"&&i&return after strippingHolder
  195. put underScore()&return after strippingHolder
  196. if script of bg fld j is empty then
  197. put "* No script for this Background Field" after strippingHolder
  198. else
  199. put script of bg fld j after strippingHolder
  200. end if
  201. put return&return after strippingHolder
  202. end repeat
  203.  
  204. repeat with L = 1 to number of cds of bg i
  205. go cd L of bg i
  206. put empty into m
  207. put empty into n
  208.  
  209. set cursor to busy
  210. put "‚Ä¢ Script of Card:"&&L&";"&&quote&short name of cd L of this bg¬¨
  211. &quote&&"of Background"&&i&return after strippingHolder
  212. put underScore()&return after strippingHolder
  213. if script of cd L of this bg is empty then
  214. put "* No script for this Card" after strippingHolder
  215. else
  216. put script of cd L of this bg after strippingHolder
  217. end if
  218. put return&return after strippingHolder
  219.  
  220. repeat with n = 1 to number of cd btns
  221. set cursor to busy
  222. put "‚Ä¢ Script of Card Button:"&&n&";"&&quote&short name of cd btn n¬¨
  223. &quote&&"of Card"&&L&&"of Background"&&i&return after strippingHolder
  224. put underScore()&return after strippingHolder
  225. if script of cd btn n is empty then
  226. put "* No script for this Card Button" after strippingHolder
  227. else
  228. put script of cd btn n after strippingHolder
  229. end if
  230. put return&return after strippingHolder
  231. end repeat
  232.  
  233. repeat with m = 1 to number of cd flds
  234. set cursor to busy
  235. put "‚Ä¢ Script of Card Field:"&&m&";"&&quote&short name of cd fld m¬¨
  236. &quote&&"of Card"&&L&&"of Background"&&i&return after strippingHolder
  237. put underScore()&return after strippingHolder
  238. if script of cd fld m is empty then
  239. put "* No script for this Card Field" after strippingHolder
  240. else
  241. put script of cd fld m after strippingHolder
  242. end if
  243. put return&return after strippingHolder
  244. end repeat
  245. end repeat
  246. end repeat
  247.  
  248. -- stacks with long names cause problems with "Script Stripper"
  249. -- at this point in the handler. The handler has therefore been
  250. -- designed to truncate long script names and store the stripped file
  251. -- using a shortened version of the original stack name (the original
  252. -- stack's name is not changed). ‚Ä¢‚Ä¢ (6/5/93)
  253.  
  254. if the number of chars in thisStack > 27 then -- file names limited to 31 char's here
  255. put the number of chars in thisStack into nameThisLong
  256. put char 1 to 10 of thisStack into stackNameTruncated_G
  257. put "..." after stackNameTruncated_G
  258. put char (nameThisLong - 10) to nameThisLong of thisStack after stackNameTruncated_G
  259. end if
  260.  
  261. -- write the variable contents to the textfile named for the stack
  262. if stackNameTruncated_G is not empty then -- if the stack name was too long
  263. open file filePath&":"&"~Script Stripper Textfiles"&":"&stackNameTruncated_G&".strip"
  264. write strippingHolder to file filePath&":"&"~Script Stripper Textfiles"&":"&stackNameTruncated_G&".strip"
  265. close file filePath&":"&"~Script Stripper Textfiles"&":"&stackNameTruncated_G&".strip"
  266. else
  267. open file filePath&":"&"~Script Stripper Textfiles"&":"&thisStack&".strip"
  268. write strippingHolder to file filePath&":"&"~Script Stripper Textfiles"&":"&thisStack&".strip"
  269. close file filePath&":"&"~Script Stripper Textfiles"&":"&thisStack&".strip"
  270. end if
  271.  
  272. pop card -- come back to where we left
  273. unlock screen
  274.  
  275. if the number of chars in strippingHolder < 29900 then
  276. -- only 30000 characters can be held in a HyperCard field
  277. answer "Would you like to view the scripts for stack:"&&quote&thisStack&quote¬¨
  278. &&"now?" with "Later" or "Yes"
  279. if it = "Yes" then
  280. lock screen
  281. show cd pict
  282. repeat with i = 1 to (number of cd btns - 1)
  283. -- show all buttons except "Hide Help"
  284. show cd btn i
  285. end repeat
  286. show bg fld "Editing Field"
  287. hide bg btn "Go Home"
  288. put strippingHolder into bg fld "Editing Field"
  289. unlock screen with barn door open
  290. else
  291. whereItsSaved
  292. end if
  293. else
  294. answer "The scripts for"&&quote&thisStack&quote&&"are"¬¨
  295. &&"too long to view within the Script Stripper, use TeachText or your"¬¨
  296. &&"word processor to open the file instead." with "Okay"
  297.  
  298. -- tell the user where the textfiles are saved
  299. whereItsSaved
  300. end if
  301.  
  302. set lockMessages to false
  303. end retrieveStackScript</script>
  304.     <background id="2747" file="background_2747.xml" name="Stripper bg 1" />
  305.     <card id="2837" file="card_2837.xml" marked="false" name="Stripper cd 1" owner="2747" />
  306. </stack>
  307.